//
//  WmcPhotoModel.swift
//  YPWatermarkCamera
//
//  Created by 周诗松 on 2022/3/29.
//

import Foundation

class WmcPhotoModel: YPNetworkJsonProtocol {
    
    enum LoadStatus {
        case notLoaded
        case loading
        case loadsuccess
        case loadFailure
    }
    
    required init() {
        
    }
    /// 图片id
    var photoId: Int = 0

    /// 项目id
    var corpId: Int = 0

    /// 项目对应用户user_id
    var userId: Int = 0

    /// 水印类型
    var wmcType: Int = 0

    /// 图片url
    var imgUrl: String = ""
    
    /// 拍照时间
    var takeTime: TimeInterval = 0
    
    /// 年月日
    var takeTimeDateStr: String = ""
    
    /// 小时分钟
    var takeTimeStr: String = ""
    
    var city: String = ""
    
    var area: String = ""
    
    /// 经度
    var longitude: Double = 0.0
    
    /// 纬度
    var latitude: Double = 0.0
    
    var loadStatus: LoadStatus = .notLoaded
    
    func mapping(mapper: HelpingMapper) {
        mapper <<< self.photoId <-- "photo_id"
        mapper <<< self.corpId <-- "corp_id"
        mapper <<< self.userId <-- "user_id"
        mapper <<< self.wmcType <-- "wmc_type"
        mapper <<< self.imgUrl <-- "img_url"
        mapper <<< self.takeTime <-- "take_time"
        mapper <<< self.longitude <-- "lon"
        mapper <<< self.latitude <-- "lat"
    }
}

struct WmcCloudPhotoDayModel {
    /// 日期
    var date: String = ""
    
    /// 地址列表
    var placeList: [WmcCloudPhotoPlaceModel] = []
    
    /// 数量
    var count: Int = 0
    
    /// 显示高度
    var height: CGFloat = 0.0
}

struct WmcCloudPhotoPlaceModel {
    /// 照片列表
    var photoList: [WmcPhotoModel] = []
    
    /// 地址
    var address: String = ""
    
    /// 经度
    var longitude: Double = 0.0
    
    /// 纬度
    var latitude: Double = 0.0
}

struct WmcPhotoGroupModel {
    /// 日期
    var date: String = ""
    
    /// 照片
    var list: [WmcPhotoModel] = []
    
    /// 地点
    var address: String = ""
    
    /// 经度
    var longitude: Double = 0.0
    
    /// 纬度
    var latitude: Double = 0.0
    
    /// 是否需要显示日期
    var isShowDate: Bool = false
}

struct WmcPhotoSearchResultModel: YPNetworkJsonProtocol {
    /// 照片
    var list: [WmcPhotoModel] = []
    
    /// 总的照片数量
    var total: Int = 0
}
